package com.cxf.windex.entity;

import com.vdurmont.emoji.EmojiParser;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Transient;

public class Address {

    public Address(){

    }

    public Address(JsTech entity){
        this.setId(entity.getId());
        this.setAddress(entity.getAddress());
        this.setName(entity.getTitle());
        this.setAddressLoc(entity.getLongitude()+" "+entity.getLatitude() );
        this.setHeadPic(entity.getHeadPic());
    }
    /**
     * 技师ID
     */
    @Id
    @ApiModelProperty(value = "技师ID")
    private String id;

    /**
     * 技师名称
     */
    @ApiModelProperty(value = "技师店铺名称")
    private String name;

    /**
     * 技师地址
     */
    @ApiModelProperty(value = "技师地址")
    private String address;

    /**
     * 技师头像
     */
    @ApiModelProperty(value = "技师头像")
    private String headPic;

    /**
     * 技师定位
     */
    @Column(name = "address_loc")
    private Object addressLoc;

    @ApiModelProperty(value = "技师距离")
    @Transient
    private String dist;

    /**
     * 获取技师ID
     *
     * @return id - 技师ID
     */
    public String getId() {
        return id;
    }

    /**
     * 设置技师ID
     *
     * @param id 技师ID
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取技师名称
     *
     * @return name - 技师名称
     */
    public String getName() {
        return name;
    }

    /**
     * 设置技师名称
     *
     * @param name 技师名称
     */
    public void setName(String name) {
        name = EmojiParser.parseToAliases(name);
        this.name = EmojiParser.parseToUnicode(name);
    }

    /**
     * 获取技师地址
     *
     * @return address - 技师地址
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置技师地址
     *
     * @param address 技师地址
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 获取技师定位
     *
     * @return address_loc - 技师定位
     */
    public Object getAddressLoc() {
        return addressLoc;
    }

    /**
     * 设置技师定位
     *
     * @param addressLoc 技师定位
     */
    public void setAddressLoc(Object addressLoc) {
        this.addressLoc = addressLoc;
    }

    public String getDist() {
        return dist;
    }

    public void setDist(String dist) {
        this.dist = dist;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }
}
